package thread;

public class MyThread extends Thread{
    public static void main(String[] args) {
        Thread t = new MyThread();
        t.setDaemon(true);
        t.start();
        for (; ;) {
            System.out.println("hello main");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
    public void run(){
        for (int i = 0; i < 2000; i++) {
            System.out.println("hello Thread");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
